Every web developer has to tangle with tables. A new open source library, displaytag, can make life with tables much more organized. find out how to combine the displaytag library with JavaScript to make a slick app that displays line item details.By Stephen strenn
Isplaying data in a table is everyday work for Web application developers. in this 10-minute solution, you will learn how to quickly cr
First of all, let's write down the learning contents of the past few days.
Then, based on the defects of displaytag and the solution, we will propose our own infinite disappointment.
OK. The column is started,
Displaytag learning notes Summary (1)
6. subset of the ListOffset is the sequence number of the first data in mylist.Length is the number of records displayed.
7. automatically set the linkThe content
Displaytag cannot export PDF, RTF?????? has been resolvedBecause of the need to do graduation design, so from today on the need to consider the issue of paging, the first is to look for available open source framework for reference use, so inAfter reviewing many articles on the internet, I locked the target to the display tag, the use of display tag, mainly focused on several aspects: paging (includingPaging to and from the database), sorting columns,
Displaytag1.1 and later support paging query on demand. the following descriptions are available on its official website: Displaytag 1.1 offers two alternative ways for working with partial lists: the first one uses the valuelist pattern, and requires that the object that you give to displaytag implements the org. displaytag. pagination. paginatedList interface.
Displaytag:Once I used displaytag to process table display, the displaytag interface was very beautiful, but there was a serious deficiency: a large amount of data would seriously damage the system performance. By default, displaytag Retrieves all the data and returns it to the page. For example, if you have 100 data records on five pages, display retrieves 100 r
Displaytag is a very common table label, but its style is a little dull. Recently, the customer is very dissatisfied with its style, so we can't improve it. The customer is God and can only follow it. The original style is as follows:
The modification is as follows:
The real master wants to modify its own display.css style sheet,CodeAs follows:
Original display.css
Table. t1 {Star: expression (this. width = "100%", this. border = "1", this.
The tag package of the table is displayed on the JSP page: DBGrid, displaytag, and ValueList.
Eric @
Blog is really good. Collect theserverside every day.ArticleYou can understand what Java developers are doing.Yesterday I saw an article about the tag package of the JSP page display table. I recommended a tag package named DBGrid for JSP, which was scolded by many people, because it connects to the database directly with connection in the tag,
Yesterday, I received a new requirement from a user: "When querying, if displaytag has only one page, I want to be able to process the page number label at the bottom of displaytag to make it consistent with the display mode of multiple pages. "The displaytag label is not displayed when only one page is displayed. It is also reasonable to see the last page of the
I used displaytag today. It's a good thing. There are some problems with Chinese support. I modified some settings in displaytag. properties, including some Chinese characters, such as the paging. Banner. item_name = record. Garbled characters are displayed. You cannot change the configuration file to displaytag_zh.properties or displaytag_zh_cn.properties. The configuration file cannot be changed to UTF-8
(dataList );
Ph. setPageNumber (pageNumber );
Ph. setObjectsPerPage (20 );
// Data passed to displaytag table name = "requestScope. msgList"
Request. setAttribute ("msgList", ph );
If (conn! = Null)
Conn. close ();
} Catch (Exception e ){
E. printStackTrace ();
Log. error (MsgAction. class, e. getCause ());
}
3. Problem:
The paginated url may be affected by the struts action, and the struts action that executes the previous action is c
Recently, due to project requirements, I want to upgrade the original displaytag1.0 to displaytag1.1. In fact, the reason for the upgrade is very simple. 1.0 is really silly, and all the data needs to be loaded at one time on each page, low Efficiency :)
The biggest improvement of Version 1.1 can be said to have finally supported the long-awaited multipart loading function, allowing users to load as much data as they want. version 1.1 supports two paging methods. The first method is to implement
Show | Chinese recently used exadel add eclipse to do a struts project, the result encountered many problems, one of the important problem is the culture of the problem, this problem in many places have met, the following will introduce a method, You can make the report column names produced by Displaytag into Chinese.
The first step is to add Jstl FMT support to the Web page.
1, will jstl need Jstl.jar and Standard.jar copy to the Webcontent\web-in
web| Design Displaytag is a very handy table display tab, suitable for MVC mode, its homepage in http://displaytag.sourceforge.net
first, the simplest case, unused
The tag iterates through each object in the list and displays all the properties in the object. Generally used for development when checking the integrity of object data.
ii. use of
property corresponds to the attributes of the object in the list (o
I did not expect that when taglib is gradually declining, there is still extreme table so well-designed, especially the new born, which is very attractive.
Http://www.extremecomponents.org/
At present, the version 1.0m1 is much more powerful than
. Add ("test string 2 ");Test. Add ("test string 3 ");Test. Add ("test string 4 ");Test. Add ("test string 5 ");Test. Add ("test string 6 ");Request. setattribute ("test", test );%>
When we want to display this list on the JSP page, we only need to write one sentenceThe display tag automatically generates a table
If the list is thrown from the control layer, the name can be expressed using the El expression.
This is the simplest use of the display tag. we can add a style to it, or define the dis
1. When a set is written into the request, cannot it be displayed during page turning? Solution: Add
2. When there is no data record, displaytag will output "nothing found to display." by default, and there is no header. Modify the tabletag. properties file in displaytag. jar to customize the Output Message and style. 1) Basic. Empty. showtable = false: Set the attribute to true, and the header will appear
(id, name, description) values (#id#, #name#, #description#) ]]>
Seq_role_table is a sequence object of oralce. It is best to create one for each table.4. Chinese problems
Displaytag export PDF Chinese problems. This problem cannot be solved simply. You can only download the source code of displaytag. In the inittable () method in org. displaytag.
In a web application, if you directly store the result set ResultSet rs in the session or reueest range,
It can be passed to jsp (the preferred choice for SUN Enterprise applications) and displayed,
However, it should be considered that if a large number of users query at the same time, the pressure on the server will be very high!
Therefore, I suggest using the following methods!
I think I should write a label myself. For example, display. javaThen define it as a tag,For the content you want to
/set methods cannot be called)
2. the lazy form data binding
Spring has few poor tags, which are basically chicken ribs. The spring tag is mainly used to bind the VO value to the input box. However, like struts, You need to bind input boxes one by one, and the syntax is extremely lengthy. When you encounter a select box, you have to handle it yourself... the typical spring Sample Page makes people feel dizzy.
The form tag of jodd gives us a method that we are too lazy to use. We only need to us
Option
>
Select
>
Jodd: Form
>
Form
>
However, a fatal weakness of jodd is that it cannot bind values of embedded objects. For example, if the order object contains a customer object, jodd cannot be bound with the following syntax like struts and spring:Input
Name
= "Customer. customerno"
>
This is because its beanutils is weaker than jakata common and uses a wrong idea. Use beanutils to modify the source code. You can download the modified source code here..
3. DataGrid data list
Both
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.